class MyBlindListModel {
  List<MyBlindListItem>? list;
  int? pageNum;
  int? pageSize;
  int? total;
  int? totalPage;

  MyBlindListModel({
    this.list,
    this.pageNum,
    this.pageSize,
    this.total,
    this.totalPage,
  });

  MyBlindListModel.fromJson(Map<String, dynamic> json) {
    if (json["list"] is List) {
      list =
          json["list"] == null
              ? null
              : (json["list"] as List)
                  .map((e) => MyBlindListItem.fromJson(e))
                  .toList();
    }
    if (json["pageNum"] is num) {
      pageNum = (json["pageNum"] as num).toInt();
    }
    if (json["pageSize"] is num) {
      pageSize = (json["pageSize"] as num).toInt();
    }
    if (json["total"] is num) {
      total = (json["total"] as num).toInt();
    }
    if (json["totalPage"] is num) {
      totalPage = (json["totalPage"] as num).toInt();
    }
  }

  static List<MyBlindListModel> fromList(List<Map<String, dynamic>> list) {
    return list.map(MyBlindListModel.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    if (list != null) {
      _data["list"] = list?.map((e) => e.toJson()).toList();
    }
    _data["pageNum"] = pageNum;
    _data["pageSize"] = pageSize;
    _data["total"] = total;
    _data["totalPage"] = totalPage;
    return _data;
  }
}

class MyBlindListItem {
  String? boxCoverImageUrl;
  int? boxId;
  String? boxImageUrl;
  String? boxName;
  double? buyPrice;
  int? collectionId;
  int? holdCount;
  bool? isGive;
  bool? isHold;
  bool? isLockedHouse;
  bool? isOpen;
  String? lockedPositionTime;

  MyBlindListItem({
    this.boxCoverImageUrl,
    this.boxId,
    this.boxImageUrl,
    this.boxName,
    this.buyPrice,
    this.collectionId,
    this.holdCount,
    this.isGive,
    this.isHold,
    this.isLockedHouse,
    this.isOpen,
    this.lockedPositionTime,
  });

  MyBlindListItem.fromJson(Map<String, dynamic> json) {
    if (json["boxCoverImageUrl"] is String) {
      boxCoverImageUrl = json["boxCoverImageUrl"];
    }
    if (json["boxId"] is num) {
      boxId = (json["boxId"] as num).toInt();
    }
    if (json["boxImageUrl"] is String) {
      boxImageUrl = json["boxImageUrl"];
    }
    if (json["boxName"] is String) {
      boxName = json["boxName"];
    }
    if (json["buyPrice"] is num) {
      buyPrice = json["buyPrice"];
    }
    if (json["collectionId"] is num) {
      collectionId = (json["collectionId"] as num).toInt();
    }
    if (json["holdCount"] is num) {
      holdCount = (json["holdCount"] as num).toInt();
    }
    if (json["isGive"] is bool) {
      isGive = json["isGive"];
    }
    if (json["isHold"] is bool) {
      isHold = json["isHold"];
    }
    if (json["isLockedHouse"] is bool) {
      isLockedHouse = json["isLockedHouse"];
    }
    if (json["isOpen"] is bool) {
      isOpen = json["isOpen"];
    }
    if (json["lockedPositionTime"] is String) {
      lockedPositionTime = json["lockedPositionTime"];
    }
  }

  static List<MyBlindListItem> fromList(List<Map<String, dynamic>> list) {
    return list.map(MyBlindListItem.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["boxCoverImageUrl"] = boxCoverImageUrl;
    _data["boxId"] = boxId;
    _data["boxImageUrl"] = boxImageUrl;
    _data["boxName"] = boxName;
    _data["buyPrice"] = buyPrice;
    _data["collectionId"] = collectionId;
    _data["holdCount"] = holdCount;
    _data["isGive"] = isGive;
    _data["isHold"] = isHold;
    _data["isLockedHouse"] = isLockedHouse;
    _data["isOpen"] = isOpen;
    _data["lockedPositionTime"] = lockedPositionTime;
    return _data;
  }
}
